package com.nkbh.sevenday.camera.camera1.util;

import android.content.Context;
import android.content.pm.PackageManager;

import com.nkbh.sevenday.camera.utils.ToastUtil;

/**
 * Created by pixel on 2018/4/17.
 *
 * 检测设备是否有需要使用的硬件
 */

public class HardwareDetectionUtil {

    /** Check if this device has a camera */
    private boolean checkCameraHardware(Context context) {
        if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)){
            // this device has a camera
            ToastUtil.showMessage(context,"this device has a camera");
            return true;
        } else {
            // no camera on this device
            ToastUtil.showMessage(context,"no camera on this device");
            return false;
        }
    }

}
